<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="../common.inc" %>    
<!-- 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link href="./css/style.css" rel="stylesheet" type="text/css" />
<link href="./css/dtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="./js/dtree.js"></script>
<script type="text/javascript" language="javascript">
<!--
	function back(){
		window.parent.location.href = "updateCustomer.html";
		window.location.target = "main";
	}
	
	function initPage(){
		if("<c:out value='${result}'/>" == 1){
			alert("<fmt:message key='common.message.updateSuccess'/>");
		}
	}
-->
</script>
</head>
<body onload="initPage()">
	<table cellpadding="0" cellspacing="0" class="table_frame" height="99%" style="width:expression(document.body.clientWidth); ">
		<tr>
			<td valign="top" class="dept_td_line">
				<div class="dept_tree_title"><fmt:message key='linkman.lable.treeTitle'/></div>
				<div class="dept_tree">
					<script type="text/javascript">
					<!--
						d1 = new dTree('d1');
						d1.add('0','-1',"<fmt:message key='linkman.lable.treeMain'/>",'','','','','','true');
					//-->
					</script>
					<c:forEach var="linkmanDept" items="${linkmansAndDepts['linkmanDepts']}">
					<script type="text/javascript">
					<!--
						d1.add('${linkmanDept.id}','0','${linkmanDept.rangeValue}','','','','','','true');
					//-->
					</script>
						<c:forEach var="linkman" items="${linkmansAndDepts['linkmans']}">
						<c:if test="${linkman.linkmanDeptId == linkmanDept.id}">
						<script type="text/javascript">
						<!--
							d1.add('${linkman.id}+999','${linkman.linkmanDeptId}','${linkman.linkmanName}'
								,'./linkman.do?action=preUpdateLinkmanInfo&id=${linkman.id}&customerId=${customer.id}&sign=${sign}','','uLinkmanFrame','','','true');
						//-->
						</script>
						</c:if>
						</c:forEach>
					</c:forEach>
					
					<script type="text/javascript">
					<!--
						d1.add('9999999999','0',"<fmt:message key='linkman.lable.treeOther'/>",'','','','','','true');
					//-->
					</script>
						<c:forEach var="linkman" items="${linkmansAndDepts['linkmans']}">
						<c:if test="${linkman.linkmanDeptId == null || linkman.linkmanDeptId == 0}">
						<script type="text/javascript">
						<!--
							d1.add('${linkman.id}+999','9999999999','${linkman.linkmanName}'
								,'./linkman.do?action=preUpdateLinkmanInfo&id=${linkman.id}&customerId=${customer.id}&sign=${sign}','','uLinkmanFrame','','','true');
						//-->
						</script>
						</c:if>
						</c:forEach>
					
					<script type="text/javascript">
					<!--
						document.write(d1);					
					//-->
					</script>
				</div>
			</td>
			<td width="10"></td>
			<td valign="top">
				<iframe src="./linkman.do?action=preUpdateLinkmanInfo&customerId=${customer.id}&id=${id}&sign=${sign}" id="uLinkmanFrame" name="uLinkmanFrame" frameborder="2" scrolling="no" width="100%" 
					onload="this.height=uLinkmanFrame.document.body.scrollHeight;"></iframe>
			</td>
		</tr>
	</table>	
</body>
</html>